using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[CreateAssetMenu(fileName = "New Flask Effect", menuName = "Data/FlaskEffect/HealthRecover")]
public class HealthRecoverFlaskEffect : FlaskItemEffect
{
    [Range(0,1)] public float RecoverRate;


    public override void FlaskUse()
    {
        base.FlaskUse();
    }

    public override float FlaskUpdate()
    {
        HealthRecover();
        return base.FlaskUpdate();
    }

    public override float FlaskEnd()
    {
        return base.FlaskEnd();
    }

    public void HealthRecover()
    { 
        PlayerStats playerStats = PlayerManager.instance.player.GetComponent<PlayerStats>();
        int maxHealth = playerStats.GetMaxHealth();
        playerStats.CurrentHealth += (int)Mathf.Ceil(maxHealth * RecoverRate);
    }
}
